<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>添加视频</title>
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
<script type="text/javascript" src="/PHPUnion/Home/Lib/Pintuer/jquery-1.11.0.js"></script>
<link rel="stylesheet" type="text/css" href="/PHPUnion/Home/Lib/Pintuer/pintuer.css" />
<script type="text/javascript" src="/PHPUnion/Home/Lib/Pintuer/pintuer.js"></script>
<script type="text/javascript" src="/PHPUnion/Home/Lib/Pintuer/respond.js"></script>
	<script type="text/javascript" src="/PHPUnion/Home/Lib/uploadify/jquery.uploadify.min.js"></script>
<link rel="stylesheet" type="text/css" href="/PHPUnion/Home/Lib/uploadify/uploadify.css" />

</head>
<body>
	<div class="container-layout">
	<div class="text-right border margin-little-bottom margin-top padding-right padding-top padding-bottom">
		<button type="button" onClick="location.href='<?php echo U('show',array('cid'=> $_GET['cid']));?>'" class="button radius-none bg-sub">
			<i class="icon-th-list"></i>
			视频列表
		</button>
		<button type="button" onClick="location.href='<?php echo U('add', array('cid'=> $_GET['cid']));?>'" class="button radius-none">
			<i class="icon-edit"></i>
			添加视频
		</button>
	</div>
</div>
<div class="container-layout">
	<form action="<?php echo U('add');?>" class="form-auto" method="POST" enctype="multipart/form-data">
		<div class="line">
			<!-- 左侧 -->
			<div class="x8">
				<table class="table table-hover table-bordered">
					<tr>
						<td width="150" align="right">视频标题</td>
						<td>
							<input type="text" name="title" size="45" class="input input-small" />
							<label><input type="checkbox" name="new_window" checked="checked" value="1" />是否新窗口</label>
						</td>
					</tr>
					<tr>
						<td align="right">频道栏目</td>
						<td>
							<select name="cid" class="input input-small" style="width:200px;">
								<?php if(is_array($cate)): $i = 0; $__LIST__ = $cate;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><option value="<?php echo ($vo["cid"]); ?>" <?php if($vo['cid'] == $_GET['cid']): ?>selected="selected"<?php endif; if($vo['cattype'] == 2): ?>disabled="disabled"<?php endif; ?>><?php echo ($vo["_name"]); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
							</select>
						</td>
					</tr>
					<tr>
						<td align="right">发布者</td>
						<td>
							<input type="text" name="uid" value="<?php echo ($_SESSION["username"]); ?>" class="input input-small" size="45"/>
							<span class="padding-left">请输入用户账户,不要输入昵称。</span>
						</td>
					</tr>
					<tr>
						<td align="right">SEO标题</td>
						<td><input type="text" name="seo_title" class="input input-small" size="45" /></td>
					</tr>
					<tr>
						<td align="right">关键词</td>
						<td><input type="text" name="keywords" class="input input-small" size="45" /></td>
					</tr>
					<tr>
						<td align="right">视频上传</td>
						<td>
							<input type="file" id="file_upload" name="video_path" />
							<input type="text" id="file_path" class="input input-small" size="45" style="display:none;" />
						</td>
						<script type="text/javascript">
						$(document).ready(function() {
								$(function(){
								$("#file_upload").uploadify({
									'debug'			:true,		// 是否开启调试模式
									'buttonText'	:'选择视频', // 上传按钮文字
									'auto'			: true, // 自动上传，true自动上传,false不自动上传
									'swf'           : '/PHPUnion/Home/Lib/uploadify/uploadify.swf', // swf插件地址
									'uploader'      : '<?php echo U("Admin/Video/UploadVideo");?>', // 上传处理脚本
									'fileTypeExts'	:'*.mp4;*.avi;*.flv;*.wmv;*.3gp;*.mpg;*.rmvb;*.mov', // 允许上传格式
									'fileTypeDesc'	:'Video File',	// 上传类型描述
									'fileSizeLimit'	:'1024MB',		// 上传限制大小
									'method'		:'POST',		// 数据发送类型
									'multi'			:false,			// 是否允许多文件
									'uploadLimit'	:1,				// 文件上传数量
									'queueSizeLimit':1,				// 一次最大上传文件数量
									 // 返回一个错误，选择文件的时候触发
									 'onSelectError':function(file, errorCode, errorMsg){
									 	switch(errorCode){
									 		case -100:
									 		alert("上传的文件数量已经超出系统限制的"+$('#file_upload').uploadify('settings','queueSizeLimit')+"个文件！");
									 		break;
									 		case -110:
									 		alert("文件 ["+file.name+"] 大小超出系统限制的"+$('#file_upload').uploadify('settings','fileSizeLimit')+"大小！");
									 		break;
									 		case -120:
									 		alert("文件 ["+file.name+"] 大小异常！");
									 		break;
									 		case -130:
									 		alert("文件 ["+file.name+"] 类型不正确！");
									 		break;
									 	}
									 },

									 // 检测FLASH失败调用
									 'onFallback':function(){
									 	alert("您未安装FLASH控件，无法上传视频！请安装FLASH控件后再试。");
									 },
									 // 上传到服务器，服务器返回相应信息到data里
									 'onUploadSuccess':function(file, data, response){
									 	$("#file_upload").val(file_path);
									 }
								});
							});
						});
						</script>
					</tr>
					<tr>
						<td align="right">视频简介</td>
						<td><textarea name="content" rows="10" style="width:100%;" class="input input-small" size="45"></textarea></td>
					</tr>
					<tr>
						<td align="right">Tag</td>
						<td><input type="text" name="tag" class="input input-small" size="45" /></td>
					</tr>
					<tr>
						<td align="right">推荐位</td>
						<td>
							<?php if(is_array($flag)): $i = 0; $__LIST__ = $flag;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><label class="padding-left">
									<input type="checkbox" name="fid[]" value="<?php echo ($vo["fid"]); ?>"/> <?php echo ($vo["fname"]); ?>
								</label><?php endforeach; endif; else: echo "" ;endif; ?>
						</td>
					</tr>
					<tr>
						<td align="right">访问方式</td>
						<td>
							<label><input type="radio" name="url_type" value="1">静态访问</label>
							<label><input type="radio" name="url_type" value="2">动态访问</label>
							<label><input type="radio" name="url_type" checked="checked" value="3">继承栏目</label>
						</td>
					</tr>
				</table>
			</div>
			<!-- 左侧 End -->

			<!-- 右侧 -->
			<div class="x4 padding-left">
				<table class="table table-hover table-bordered">
					<tr class="bg">
						<td>缩略图</td>
					</tr>
					<tr>
						<td>
							<img src="./Home/Admin/View/Public/images/upload_pic.png" width="150" height="100" />
							<input type="file" name="thumb"/>
						</td>
					</tr>
					<tr class="bg">
						<td>播放次数</td>
					</tr>
					<tr>
						<td><input type="text" name="click" value="0" class="input input-small" size="45" /></td>
					</tr>
					<tr class="bg">
						<td>状态</td>
					</tr>
					<tr>
						<td>
							<label><input type="radio" name="content_status" value="0"/> 未审核</label>
							<label><input type="radio" name="content_status" value="1" checked="checked"/> 已审核</label>
						</td>
					</tr>
					<tr class="bg">
						<td>发布时间</td>
					</tr>
					<tr>
						<td><input type="text" name="addtime" value="<?php echo date('Y-m-d H:i:s',time());?>" class="input input-small" size="45" /></td>
					</tr>
				</table>
			</div>
			<!-- 右侧 End -->
		</div>
		<div class="border margin-little-top padding">
			<button type="submit" class="button radius-none bg-main">
				提交保存
			</button>
		</div>
	</form>
</div>
</body>
</html>